package groovy.jmx.builder

import groovy.jmx.builder.node.SimpleNodeData

class JmxDescriptionFactory extends AbstractFactory {
    SimpleNodeData data

    public Object newInstance(FactoryBuilderSupport builder, Object nodeName, Object nodeArgs, Map nodeAttribs) {
        data = new SimpleNodeData(value: nodeArgs)
        return data
    }

    public boolean onHandleNodeAttributes(FactoryBuilderSupport builder, Object node, Map nodeAttribs) {
        return true;
    }

    public void setParent(FactoryBuilderSupport builder, Object parentNode, Object childNode) {
        parentNode.description = childNode.value
    }

    public boolean isLeaf() {
        return true
    }
}